package com.wty.cmims.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wty.cmims.pojo.Code;
import com.wty.cmims.pojo.MedicalDevice;
import com.wty.cmims.pojo.ResponseResult;
import com.wty.cmims.service.MedicalDeviceService;
import com.wty.cmims.mapper.MedicalDeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author wty
* @description 针对表【medical_device】的数据库操作Service实现
* @createDate 2024-12-09 20:41:53
*/
@Service
public class MedicalDeviceServiceImpl extends ServiceImpl<MedicalDeviceMapper, MedicalDevice>
    implements MedicalDeviceService{
    @Autowired
    private MedicalDeviceMapper medicalDeviceMapper;
    @Override
    public ResponseResult<Map<String,Object>> medicalDevicesFindByInstitutionId(Integer institutionId) {
        ResponseResult<Map<String,Object>> responseResult = new ResponseResult<>();
        List<Map<String,Object>> medicalDevices = medicalDeviceMapper.findMedicalDevicesByInstitutionId(institutionId);
        if (medicalDevices != null) {
            responseResult.setCode(Code.SUCCESS);
            responseResult.setMessage("查询医疗器械信息成功");
            responseResult.setDatas(medicalDevices);
        } else {
            responseResult.setCode(Code.ERROR);
            responseResult.setMessage("查询医疗器械信息失败");
        }
        return responseResult;
    }
}




